<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var reTest01 = /a/;
        var reTest02 = /a/i;
        var reTest03 = /\d+/;
        var reTest04 = /^\d+$/;

        var sTr01 = 'abc';
        var sTr02 = 'Abc';
        var sTr03 = '123456';
        var sTr04 = '123456abcdef';

        // alert(reTest01.test(sTr01));
        // alert(reTest01.test(sTr02));
        // alert(reTest02.test(sTr02));
        // alert(reTest03.test(sTr03));
        // alert(reTest03.test(sTr04));
        alert(reTest04.test(sTr03));
        alert(reTest04.test(sTr04));
    </script>
</head>
<body>
    
</body>
</html>